package ai.people.netmon.framework.domain.common.gather;

import ai.people.netmon.framework.businessenum.AnalysisSourceEnum;
import ai.people.netmon.framework.domain.facebook.probe.entity.FacebookAccount;
import ai.people.netmon.framework.domain.twitter.probe.entity.TwitterAccount;
import ai.people.netmon.framework.domain.youtube.probe.entity.YoutubeAccount;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 推送到探测新的账号 推送到采集的topic msg 实体
 *
 * @author zhenglin
 * @since 2022/3/16
 */
@Data
@NoArgsConstructor
@JSONType(naming = PropertyNamingStrategy.SnakeCase)
public class NewAccountNeedGrabMsg {
    /**
     * 用户名
     */
    private String userName;
    /**
     * 用户id
     */
    private String userId;
    /**
     * url
     */
    private String url;
    /**
     * 源类型
     */
    private String sourceType;


    public NewAccountNeedGrabMsg(FacebookAccount x) {
        this.userName = x.getAccountName();
        this.userId = null;
        this.url = x.getAccountLink();
        this.sourceType = AnalysisSourceEnum.facebook.name();
    }

    public NewAccountNeedGrabMsg(TwitterAccount x) {
        this.userName = x.getAccountName();
        this.userId = null;
        this.url = x.getAccountLink();
        this.sourceType = AnalysisSourceEnum.twitter.name();
    }

    public NewAccountNeedGrabMsg(YoutubeAccount x) {
        this.userName = x.getAccountName();
        this.userId = null;
        this.url = x.getAccountLink();
        this.sourceType = AnalysisSourceEnum.youtube.name();
    }
}
